package com.ysalliance.getFan.organization.ui.welcome;

/**
 * @author lucas
 * created at 2019/7/28 11:52 A
 * 欢迎界面（实现第一次启动引导界面，后面则自动进入主界面）
 */

import android.database.sqlite.SQLiteDatabase;
import android.os.Handler;

import com.blankj.utilcode.util.ActivityUtils;
import com.ysalliance.getFan.organization.R;
import com.ysalliance.getFan.organization.ui.OrganizationActivity;
import com.ysalliance.getFan.organization.ui.login.LoginActivity;
import com.ysalliance.getFan.organization.ui.base.LucasBaseActivity;

import org.litepal.LitePal;

//public class WelcomeActivity extends BaseActivityWel implements Runnable {
public class WelcomeActivity extends LucasBaseActivity {


    @Override
    public int bindContentView() {
        return R.layout.activity_welcome;
    }


    @Override
    public void afterView() {
        super.afterView();

        //生成数据库
        SQLiteDatabase db = LitePal.getDatabase();

        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                if(userBean!=null){
                    ActivityUtils.startActivity(OrganizationActivity.class);
                    finish();
                }else {
                    ActivityUtils.startActivity(LoginActivity.class);
                    finish();
                }

            }
        }, 1000);
    }


}
